import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // 首页
    {
      path: "/",
      component: () => import("@/views/home/Home.vue"),
    },
    // 店铺详情
    {
      path: "/shop",
      component: () => import("@/views/home/Shop.vue"),
    },
    // 登录
    {
      path: "/login",
      component: () => import("@/views/user/Login.vue"),
    },
    // 注册
    {
      path: "/register",
      component: () => import("@/views/user/Register.vue"),
    },
    // 购物车
    {
      path: "/cart",
      component: () => import("@/views/cart/Cart.vue"),
    },
    // 饭店的列表页面
    {
      path: "/shopList",
      component: () => import("@/views/home/ShopList.vue"),
    },
    // 订单确认页面
    {
      path: "/orderConfirm",
      component: () => import("@/views/order/Order.vue"),
    }
  ]
})

export default router